#ifndef __IOCTL_H__
#define __IOCTL_H__

#include "winioctl.h"
// ++++++++++++++++++++++++++++++++++++++++++++++
/*
					IOCTL CODE
*/
//+++++++++++++++++++++++++++++++++++++++++++++++

// 1:	------------------UTC-------------------
	//Device ID
	#define 	STREAD_DEVICE_UTC		32768

	
	//++FM
	//Function index: ( 1000 - 1020 )
	#define	FM_SET_FREQ				1000
	#define	FM_GET_FREQ				1001
	#define	FM_SET_MUTE				1002
	#define	FM_GET_MUTE				1003
	#define	FM_SET_AUDIO_LEVEL		1004
	#define	FM_GET_AUDIO_LEVEL		1005
	#define	FM_SET_POWER_MODE		1006
	#define	FM_GET_POWER_MODE		1007
	#define	FM_SET_EMPHASIS			1008
	#define	FM_GET_EMPHASIS			1009
	#define	FM_SET_AMPLITUDE			1010
	#define	FM_GET_AMPLITUDE			1011
	#define	FM_SET_EMPHASIS_LEVEL	1012
	#define	FM_GET_EMPHASIS_LEVEL	1013
	#define	FM_OPEN					1014
	#define	FM_CLOSE					1015
	#define	FM_DEBUG_IIC				1016
	#define FM_GET_CHIP_STATUS		1017

	
	//Decice Ioctl:
	//ningwei amend time:2009/06/25 11:15 MTK
	#define IOCTL_FMC_GET_CUR_FRE     CTL_CODE(FILE_DEVICE_UNKNOWN, 0x1000, METHOD_BUFFERED, FILE_ANY_ACCESS)
	#define IOCTL_FMC_SET_CUR_FRE     CTL_CODE(FILE_DEVICE_UNKNOWN, 0x1001, METHOD_BUFFERED, FILE_ANY_ACCESS)
	#define IOCTL_FMC_POWER_ON        CTL_CODE(FILE_DEVICE_UNKNOWN, 0x1007, METHOD_BUFFERED, FILE_ANY_ACCESS)
	#define IOCTL_FMC_POWER_DOWN      CTL_CODE(FILE_DEVICE_UNKNOWN, 0x1008, METHOD_BUFFERED, FILE_ANY_ACCESS)
	#define ODM_MSG_SET_SPEAKER_MUTE 0x41c // dwParam1 set to 1 : Enable 0:disable amp

	#define		IOCTL_UTC_FM_SET_FREQ			CTL_CODE( STREAD_DEVICE_UTC, FM_SET_FREQ, METHOD_BUFFERED ,FILE_ANY_ACCESS)
	#define		IOCTL_UTC_FM_GET_FREQ			CTL_CODE( STREAD_DEVICE_UTC, FM_GET_FREQ, METHOD_BUFFERED ,FILE_ANY_ACCESS)
	#define 	IOCTL_UTC_FM_SET_MUTE			CTL_CODE( STREAD_DEVICE_UTC, FM_SET_MUTE, METHOD_BUFFERED ,FILE_ANY_ACCESS)
	#define 	IOCTL_UTC_FM_GET_MUTE			CTL_CODE( STREAD_DEVICE_UTC, FM_GET_MUTE, METHOD_BUFFERED ,FILE_ANY_ACCESS)
	#define 	IOCTL_UTC_FM_SET_AUDIO_LEVEL	CTL_CODE( STREAD_DEVICE_UTC, FM_SET_AUDIO_LEVEL, METHOD_BUFFERED ,FILE_ANY_ACCESS)	
	#define 	IOCTL_UTC_FM_GET_AUDIO_LEVEL	CTL_CODE( STREAD_DEVICE_UTC, FM_GET_AUDIO_LEVEL, METHOD_BUFFERED ,FILE_ANY_ACCESS)	
	#define 	IOCTL_UTC_FM_SET_POWER_MODE	CTL_CODE( STREAD_DEVICE_UTC, FM_SET_POWER_MODE, METHOD_BUFFERED ,FILE_ANY_ACCESS)	
	#define 	IOCTL_UTC_FM_GET_POWER_MODE	CTL_CODE( STREAD_DEVICE_UTC, FM_GET_POWER_MODE, METHOD_BUFFERED ,FILE_ANY_ACCESS)	
	#define 	IOCTL_UTC_FM_SET_EMPHASIS		CTL_CODE( STREAD_DEVICE_UTC, FM_SET_EMPHASIS, METHOD_BUFFERED ,FILE_ANY_ACCESS)	
	#define 	IOCTL_UTC_FM_GET_EMPHASIS		CTL_CODE( STREAD_DEVICE_UTC, FM_GET_EMPHASIS, METHOD_BUFFERED ,FILE_ANY_ACCESS)	
	#define 	IOCTL_UTC_FM_SET_AMPLITUDE		CTL_CODE( STREAD_DEVICE_UTC, FM_SET_AMPLITUDE, METHOD_BUFFERED ,FILE_ANY_ACCESS)	
	#define 	IOCTL_UTC_FM_GET_AMPLITUDE		CTL_CODE( STREAD_DEVICE_UTC, FM_GET_AMPLITUDE, METHOD_BUFFERED ,FILE_ANY_ACCESS)	
	#define 	IOCTL_UTC_FM_SET_EMPHASIS_LEVEL	CTL_CODE( STREAD_DEVICE_UTC, FM_SET_EMPHASIS_LEVEL, METHOD_BUFFERED ,FILE_ANY_ACCESS)	
	#define 	IOCTL_UTC_FM_GET_EMPHASIS_LEVEL	CTL_CODE( STREAD_DEVICE_UTC, FM_GET_EMPHASIS_LEVEL, METHOD_BUFFERED ,FILE_ANY_ACCESS)	
	#define 	IOCTL_UTC_FM_OPEN					CTL_CODE( STREAD_DEVICE_UTC, FM_OPEN, METHOD_BUFFERED ,FILE_ANY_ACCESS)
	#define 	IOCTL_UTC_FM_CLOSE				CTL_CODE( STREAD_DEVICE_UTC, FM_CLOSE, METHOD_BUFFERED ,FILE_ANY_ACCESS)
	#define 	IOCTL_UTC_FM_DEBUGIIC			CTL_CODE( STREAD_DEVICE_UTC, FM_DEBUG_IIC, METHOD_BUFFERED ,FILE_ANY_ACCESS)
    #define    IOCTL_UTC_FM_GET_CHIP_STATUS     CTL_CODE( STREAD_DEVICE_UTC, FM_GET_CHIP_STATUS, METHOD_BUFFERED ,FILE_ANY_ACCESS)


	//++BlueTooth
	//Function index: ( 1021 - 1050 )	
	#define	SETSPEAKVOL			1050
	#define	GETSPEAKVOL			1051
	#define	SETMICVOL			1052
	#define	GETMICVOL			1053
	#define	SETAUDIOMODE		1054	
	#define	GETAUDIOMODE		1055
	#define	SETBC03MODE        1056
	#define	SETBC04MODE        1057
	#define	GETBTMODE        	1058



	//Decice Ioctl:
	#define	IOCTL_UTC_BT_SETSPEAKVOL		CTL_CODE( STREAD_DEVICE_UTC, SETSPEAKVOL, METHOD_BUFFERED ,FILE_ANY_ACCESS)
	#define 	IOCTL_UTC_BT_GETSPEAKVOL		CTL_CODE( STREAD_DEVICE_UTC, GETSPEAKVOL, METHOD_BUFFERED ,FILE_ANY_ACCESS)
	#define	IOCTL_UTC_BT_SETMICVOL		CTL_CODE( STREAD_DEVICE_UTC, SETMICVOL, METHOD_BUFFERED ,FILE_ANY_ACCESS)
	#define 	IOCTL_UTC_BT_GETMICVOL		CTL_CODE( STREAD_DEVICE_UTC, GETMICVOL, METHOD_BUFFERED ,FILE_ANY_ACCESS)
	#define 	IOCTL_UTC_BT_SETAUDIOMODE	CTL_CODE( STREAD_DEVICE_UTC, SETAUDIOMODE, METHOD_BUFFERED ,FILE_ANY_ACCESS)
	#define 	IOCTL_UTC_BT_GETAUDIOMODE	CTL_CODE( STREAD_DEVICE_UTC, GETAUDIOMODE, METHOD_BUFFERED ,FILE_ANY_ACCESS)
	#define 	IOCTL_UTC_BT_SETBC03MODE		CTL_CODE( STREAD_DEVICE_UTC, SETBC03MODE, METHOD_BUFFERED ,FILE_ANY_ACCESS)
	#define 	IOCTL_UTC_BT_SETBC04MODE		CTL_CODE( STREAD_DEVICE_UTC, SETBC04MODE, METHOD_BUFFERED ,FILE_ANY_ACCESS)
	#define 	IOCTL_UTC_BT_GETBTMODE		CTL_CODE( STREAD_DEVICE_UTC, GETBTMODE, METHOD_BUFFERED ,FILE_ANY_ACCESS)

	//++AVIN
	//Function index: (1051 - 1060 )
	//Decice Ioctl:



	//++Version
	//Function index: ( 1061 - 1070	)
	#define	GETNBOOTVERSION		1061
	#define	GETGUID				1062

	//Decice Ioctl:
	#define	IOCTL_UTC_VERSION_GETNBOOTVERSION	CTL_CODE( STREAD_DEVICE_UTC, GETNBOOTVERSION, METHOD_BUFFERED ,FILE_ANY_ACCESS)
	#define 	IOCTL_UTC_VERSION_GETGUID			CTL_CODE( STREAD_DEVICE_UTC, GETGUID, METHOD_BUFFERED ,FILE_ANY_ACCESS)



	//++Other Device
	//Function index: ( 1071 - 1200 )
	//Decice Ioctl:


	//++Get Device Code
	//Function index: (1201 - 1210 )
	#define	UTCGetDeviceCode		1201
	
	//Decice Ioctl:
	#define	IOCTL_UTC_GETCODE		CTL_CODE( STREAD_DEVICE_UTC, UTCGetDeviceCode, METHOD_BUFFERED ,FILE_ANY_ACCESS)


// 3:	------------------Display-------------------

	//ULONG DrvEscape( SURFOBJ *pso, ULONG iEsc, ULONG cjIn, PVOID pvIn, ULONG cjOut, PVOID pvOut )
	#define DRVESC_HAL_IMGAGE_ROTATE		6601
	//Image and Rotate
	#define VIDEO_IMAGE_HORIZONTAL		0x01
	#define VIDEO_IMAGE_VERTICAL			0x02
	#define VIDEO_ROTATE_ORIGIN			0x03
	#define VIDEO_IMAGE_NORMAL			0x04



// ++++++++++++++++++++++++++++++++++++++++++++++
/*
					Message CODE
*/
//+++++++++++++++++++++++++++++++++++++++++++++++
	#define	NoDefine		0x0	

// 1:	------------------UTC-------------------
	
	//++Avin Detect
	//Message Name(No use)
	#define 	AvinDetectMsg		L"AVIN_DETECT_MSG"
	
	//WParam
	#define 	PlugIn				0x1
	#define 	PlugOut				0x2
	
	//LParam
	//NoDefine
	

// 2:	------------------keyboard-------------------

	//++Avin Detect
	//Message Name
	#define 	_KEYBOARD_MSG_	L"SCAN_CODE_MENU"

	//WParam
	#define	Key_Menu		(0x1)

	//LParam
	#define 	Key_Up			(0x1)
	#define 	Key_Down		(0x2)









// ++++++++++++++++++++++++++++++++++++++++++++++
/*
					Event 	CODE
*/
//+++++++++++++++++++++++++++++++++++++++++++++++
	#define		NoDefine			0x0	

// 1:	------------------UTC-------------------
	
	//++Avin Detect
	//Evnet Name
	#define 	_AVIN_DETECT_EVENT_		L"_AVIN_DETECT_EVENT_"
	
	//Event Data
	#define 	PlugIn				0x1
	#define 	PlugOut				0x2
	#define	AppExit			0x3		//Set Event data to AppExit when App exit on app code;
	#define	AppWorking		0x4		//Set Event data to AppWorking when CVBS signal is disappear. if you want the app go on work.
	#define	AvinSleep		0x5		
	#define	AvinWakeup		0x6

	//++
	//Evnet Name
	#define TRACK_CONTROL_EVENT_NAME			L"TRACK_CONTROL_EVENT_NAME"
	#define TRACK_CONTROL_MSGQUEUE_NAME		L"TRACK_CONTROL_MSGQUEUE_NAME"
	
	//Event Data
	#define	TRACK_CONTROL_EXIT_THREAD	(0xff)  //Don't send this event data to drive, unless you want to close it.
	#define	TRACK_CONTROL_WAVE_OPEN		(0xf1)
	#define	TRACK_CONTROL_WAVE_CLOSE	(0xf2)


// 2:	------------------SDMMC-------------------
	
	//++SDMMC Detect
	//Evnet Name
	#define 	_SDMMC_DETECT_EVENT_		L"_SDMMC_DETECT_EVENT_"
	
	//Event Data
	#ifndef 	PlugIn
		#define 	PlugIn				0x1
	#endif
	
	#ifndef PlugOut
		#define 	PlugOut				0x2
	#endif



///+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++

#define WODM_BTSTART					100
#define WODM_BTSTOP						101
#define WODM_BTSTATE					102
#define WODM_FMOPEN_MUTE_SPEAKER			103
#define WODM_FMOPEN_UNMUTE_SPEAKER		104

#endif
